package com.graduationproject.examonline.question.controller;

import com.graduationproject.examonline.question.service.QuestionService;
import com.graduationproject.examonline.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("api/question")
public class QuestionController {

    @Autowired
    private QuestionService questionService;

    @GetMapping("/getQuestionById")
    public  Result getQuestionById(String id){
        return questionService.getQuestionById(id);
    }

    @PostMapping("/insertQuestion")
    public Result insertQuestion(@RequestBody List<Map<String, Object>> questionList){
        return questionService.insertQuestion(questionList);
    }
}
